<?php

use think\facade\Route;

//TODO 使用/text/:id 类型路由名时，路由表需添加为 text/<id>
Route::group('/v1', function ()
{
    //登入
    Route::post('/wx/login', 'AuthController/wxLogin');
    //上传文件
    Route::post('/files', 'FilesController/upload');

    //需要登入的api
    Route::group('',function ()
    {
        //短信
        Route::post('/sms', 'AuthController/sendSms');
        //TODO 弃用
        Route::get('/sms', 'AuthController/validateSms');
        //身份证验证 TODO 弃用
        Route::post('/idcard', 'AuthController/validateIDCard');

        Route::group('' , function (){
            Route::get('reservation/:id' , 'ReservationController/getReservation');
            Route::delete('reservation/:id' , 'ReservationController/unsubscribe');
        })->model('\app\model\Order');
        Route::group('' , function (){
            Route::get('hotel/:id' , 'HotelController/getHotel');
        })->model('\app\model\Hotel');
        Route::post('reservation' , 'ReservationController/reservation');
        Route::get('reservationAll' , 'ReservationController/getReservationAll');
        Route::get('delReservationAll' , 'ReservationController/getUnsubscribeAll');
        Route::get('RoomList' , 'RoomController/getRoomList');
        Route::get('UserInfo' , 'UserController/getUserInfo');

    })->middleware(\app\middleware\JwtAuth::class);
});

